package cn.cnf.service;


import cn.cnf.common.enums.VerifyState;
import cn.cnf.common.enums.WorkType;
import cn.cnf.entity.Chapter;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 服务接口
 *
 * @author ZhuMeiYi
 * @description
 * @since 2020-12-04 15:18:43
 */
public interface ChapterService extends IService<Chapter> {

    /**
     * 通过来源id获取该来源下的章节
     *
     * @param comicId
     * @param type
     * @param state
     * @return
     */
    List<Chapter> selectByFromId(String comicId, WorkType type, VerifyState state);

    /**
     * 通关审核状态筛选表中全部章节
     *
     * @param current
     * @param pageSize
     * @return
     */
    IPage<Chapter> selectByState(Integer current, Integer pageSize, VerifyState state);

    /**
     * 修改某章节的审核状态
     *
     * @param chapterId
     * @param state
     * @return
     */
    Integer chapterVerify(String chapterId, WorkType workType,VerifyState state);

    /**
     * 新增章节
     * @param chapter
     * @return
     */
    String addOrUpdateChapter(Chapter chapter);

    /**
     * 获取全部章节信息
     *
     * @param fromId
     * @return
     */
    List<Chapter> getChapterById(String fromId,WorkType type);

    /**
     * 删除章节
     * @param fromId
     * @param type
     * @return
     */
    boolean delete(String fromId,WorkType type);

    List<Chapter> getVerifyingChapter(String fromId, WorkType type);
}
